<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/styles/grid.css" rel="stylesheet" type="text/css" />

<script language="JavaScript"  src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript">
var currenNoteId = null;
var currentHouseNumber = null;
var currentStatus = null;
var currentPeriodId= null;

function isShowButtom(){
   return "${isShowButtom}";
}
function openBuildAnewForOne(){
	if(currenNoteId == "" || currenNoteId == null){
		Alert("${key.tipsBySelect}");
		return;
	}
	var message = "你确定要重新生成" + currentHouseNumber + "的通知单吗?";
	AskConfirm(message,"connTabPanel","buildAnewForOne");
}
function buildAnewForOne(){
		var url = "${ctx}/charge_noteAction.do?method=buildNotesAnewForOne";
		var params = "houseId=${houseId}";
		sendAjaxRequest(url,params,function(result){
		    ajaxSubmitException(result.responseText);
			if(result.responseText == "true"){
				SuccessAlert("重新生成成功！");
				search();
			}else if(result.responseText == "false"){
				FailureAlert("重新生成失败!");
			}
		});
}
function search(){
	var param = $('noteSearchForm').serialize();
	window.frames("requistionListFrame").document.location.href = "${ctx}/charge_cashieringAction.do?method=requestRequistionList&"+param;
}
function openPrintSingleton(aObj){
		if(currenNoteId == "" || currenNoteId == null || currentPeriodId == null){
			Alert("${key.tipsBySelect}");
			return;
		}
		aObj.href = "${ctx}/applets/appletShow.jsp?reportName=printChargeNoteService&noteId=" + currenNoteId+"&periodId="+currentPeriodId;
		aObj.target = "blank";
		aObj.click();
	}
</script>
</head>
<body>
<div style="background-color: #F8FBFE;">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="right">
                <table border="0" align="left" cellpadding="0" cellspacing="1" id="search01">
                <form name="noteSearchForm" id="noteSearchForm" action="" method="post" target="requistionListFrame">
            	<input type="hidden" name="houseId" value="${houseId}"/>
            	<input type="hidden" name="isVirtual" value="${isVirtual}">
            	<input type="hidden" name="proRightId" value="${proRightId}">
                  <tr>
                    <td class="td_search" ><span class="grid align_left">${key.charge_requisitionMain_period}：</span></td>
                        <td class="td_search">
                        	<pms:unitedSelect
                        		name="periodId"
                        		optionLabel="period"
                        		optionValue="keyword"
                        		selectText="${key.select}"
                        		dataList="${periodList}"
                        		style="width:90px;">
                        	</pms:unitedSelect>
                        </td>
			      	<td class="td_search">${key.charge_requisitionMain_requisitionNum}：</td>
                  	<td class="td_search"><input name="requisitionNum" type="text" class="inputtext" size="16" maxlength="40"></td>
                  	<td class="td_search">${key.charge_requisitionMain_validity}：</td>
                  	<td class="td_search">
                  		<select name="validity" style="width:90px;">
	                      <option value="">${key.select}</option>
	                      <option value="1">${key.charge_requisitionMain_efficacy}</option>
	                      <option value="0">${key.charge_requisitionMain_inefficacy}</option>
	                    </select>
                    </td>
                    <td class="td_search"><table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td class="buttonOffLeft" id="btn1_11"></td>
                          <td class="buttonOffMiddle" id="btn1_12" onblur="btn_change(1)" onClick="search();" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)"><img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle">
                          ${key.search}</td>
                          <td class="buttonOffRight" id="btn1_13"></td>
                        </tr>
                    </table></td>
                  </tr>
                  </form>
                </table>            </td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="right"><!--------------------------右边图标01----------------------------------->
            <table border="0" cellpadding="0" cellspacing="0" id="ico1">

				  <tr>  <c:if test="${isShowButtom}">
				  <pms:AuthTag authName="menu.nopage.common.buildNotesAnew.two">
                     <td  class="toolbarico" ><a href="#"  onclick="openBuildAnewForOne();" onfocus="this.blur()"><img src="${ctx}/images/ico_charge_cxsc.gif" alt="${key.charge_requisitionMain_redefine}" width="16" height="16" border="0" align="absbottom"/>&nbsp;${key.charge_requisitionMain_redefine}</a> </td>
					 <td class="toolbar_line">|</td>
				</pms:AuthTag>
					<td class="toolbarico"><a href="#" onclick="openPrintSingleton(this);" onFocus="this.blur()"><img src="${ctx}/images/ico_printer.gif" alt="打印" width="16" height="16" border="0" align="absbottom"></a></td>
                  </c:if>
                  </tr>
                </table></td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td valign="top">
			<iframe src="${ctx}/charge_cashieringAction.do?method=initRequistionList&houseId=${houseId}&isVirtual=${isVirtual}&proRightId=${proRightId}" name="requistionListFrame" id="requistionListFrame" width="100%"  height="400px"  frameborder="0" border="0"  scroll="no" ></iframe>
      </td>
    </tr>
  </table>
</div>
</body>
</html>
